<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<h1>java实现</h1>
<%
    for (int i = 1;i<100;i++){
        out.write("<p>"+i+"</p>");
    }
%>

<h1>JSTL标签实现</h1>

<c:forEach var="i" begin="1" end="100">
    <p>${i}</p>
</c:forEach>
<sql:setDataSource var="datasource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/sctu_javaweb_2018?serverTimezone=UTC" user="root" password="123456" scope="request"/>
<sql:query var="userResults" dataSource="${datasource}">
select * from t_users where name=?<sql:param value="${name}"/>
</sql:query>
<sql:update var="updatetest" dataSource="${datasource}">
    update user set id =?and name=?
    <sql:param value="100"/>
    <sql:param>jstl</sql:param>
</sql:update>
</body>
</html>
